// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.jasmin.unit.compiler;

import org.apache.commons.lang.StringUtils;

public final class NewUnitCall {
  public String fieldName;
  public String unitName;
  public String qualifiedUnitName;
  public String[] unitArgs;
  
  public NewUnitCall(String fieldName, 
      String qualifiedUnitName, 
      String unitName,
      String constructorCodeLine, String... constructorParams) {
    this.fieldName = fieldName;
    this.unitName = unitName;
    this.qualifiedUnitName = qualifiedUnitName;
    this.unitArgs = constructorParams;
  }
  
  public String toString() {
    return fieldName + " = " + qualifiedUnitName + "(" + StringUtils.join(unitArgs, ", ") + ")";
  }
}